<!DOCTYPE html>
<!--[if !(IE 8) ]><!-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<!--<![endif]-->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>{:L('system_name')} &rsaquo; 忘记密码</title>
    <!-- 最新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="__STATIC__/bootstrap/css/bootstrap.min.css">

    <link rel='stylesheet' id='login-css'  href="__PUBLIC__/admin/css/login.css" type="text/css" />

    <script src="__JS__/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="__STATIC__/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
    <meta name='robots' content='noindex,follow' />
</head>
<body class="login">
<div class="wrapper">
    <h1><a href="/admin" title="{:L('system_name')}" tabindex="-1"><img src="__PUBLIC__/admin/images/loginlogo.png" height="59"></a></h1>
    <div class="login-body">
        <h2>重置密码</h2>
        <form method="post" id="myform" action="{:U('Login/repassword')}">
            <div class="form-group">
                <input type="password" class="form-control" name="password" placeholder="新密码">
            </div>
            <div class="form-group">
                <input type="password" class="form-control" name="repassword" placeholder="确认密码">
            </div>
            <div class="form-group" style="position: relative">
                <input type="text" class="form-control" size="6" name="verify" placeholder="验证码" style="width:50%" >
                <img src="{:U('Login/verify')}" onclick="this.src='{:U('Login/verify')}'+'&'+Math.random()" style="position: absolute;top: 0; left: 52%;"></td>
            </div>
            <div class="submit">
                <input type="hidden" name="code" value="{$code}" />
                <input type="submit" value="确认" class="btn btn-primary" >
            </div>
        </form>
        <div class="forget" style="margin-top: 60px;">
            <a href="{:U('Login/index')}">
                <span>登录</span>
            </a>
        </div>
    </div>
</div>
<script>
    $("#myform").submit(function () {
        var self = $(this);
        $.post(self.attr("action"), self.serialize(), success, "json");
        return false;

        function success(data) {
            if (data.status == 1) {
                layer.msg(data.info, {
                    icon: 1,
                    time: 2000 //2秒关闭（如果不配置，默认是3秒）
                }, function(){
                    setTimeout(function(){
                        window.location.href = data.url;
                    },500);
                });

            } else {
                layer.msg(data.info, {
                    icon: 2,
                    time: 2000 //2秒关闭（如果不配置，默认是3秒）
                });
            }
        }
    });
</script>
</body>
</html>

